<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      th:replace="fragments/layout(title='老人档案-转入',cssPaths='/static/css/elder/elderly/transefer.css',jsPaths='/static/js/elder/elderly/bindmeal.js')">
<div class="right" th:fragment="right">
    <!--面包屑-->
    <div class="breadcrumb layui-bg-gray">
                <span class="layui-breadcrumb" lay-separator=">">
                    <a th:href="@{/}">首页</a>
                      <a href="">客戶管理</a>
                        <a href="/elderly">老人档案</a>
                        <a><cite>套餐绑定</cite></a>
                </span>
    </div>

    <!--主体内容区-->
    <div class="form-content">
        <form class="layui-form" id="myform" th:action="@{/elderly/meal/bind}" method="post">
            <blockquote class="layui-elem-quote layui-quote-nm" style="font-size: 18px;">请选择套餐(老人姓名：<span th:text="${elderly.name}"></span>  &nbsp;&nbsp;&nbsp;&nbsp;身份证号：<span th:text="${elderly.idNo}"></span> &nbsp;&nbsp;&nbsp;&nbsp;现有套餐：<span th:text="${(elderly.mealName != null && elderly.mealName != '') ? elderly.mealName : '无' }"></span>  &nbsp;&nbsp;&nbsp;&nbsp; <span th:if="${elderly.mealName != ''}">截止日期：<span th:text="${#dates.format(elderly.mealEndTime,'yyyy-MM-dd')}"></span></span>)</blockquote>
            <table class="layui-table">
                <thead>
                    <tr>
                        <th>套餐名称</th>
                        <th>包含服务</th>
                        <th>价格</th>
                        <th>操作</th>
                    </tr>
                </thead>
                <tbody>
                    <tr th:each="m:${mealList}">
                        <td th:text="${m.name}"></td>
                        <td><span th:each="mi:${m.itemsList}" th:text="${mi.itemsName} + ' '"></span></td>
                        <td th:text="${m.price}"></td>
                        <td>
                            <input type="radio" th:value="${m.id}" name="tcId" style="display: inline;" th:checked="${elderly.mealId > 0 && m.id == elderly.mealId}">
                            <input type="hidden" th:disabled="${m.id != elderly.mealId}" name="tcName" th:value="${m.name}">
                        </td>
                    </tr>
                    <tr>
                        <td colspan="3" style="text-align: center">无套餐</td>
                        <td>
                            <input type="radio" value="-1" name="tcId" style="display: inline;" th:checked="${elderly.mealId  < 0}">
                            <input type="hidden" name="tcName" value="" th:disabled="${elderly.mealId  > 0}" >
                        </td>
                    </tr>
                </tbody>
            </table>
            <div class="layui-form-item">
                <div class="layui-input-block">
                    <input type="hidden" name="elderlyId" th:value="${elderly.id}"/>
                    <input type="hidden" name="type" value="1">
                    <button class="layui-btn  layui-btn-normal" type="button" id="bind">确定</button>
                    <button class="layui-btn" lay-submit type="button" id="xufei" th:if="${expire}">续费</button>
                    <a href="/elderly" class="layui-btn layui-btn-primary">返回</a>
                </div>
            </div>
        </form>
    </div>
</div>
</html>